import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { ProductModule } from './product/product.module';
import { AuthModule } from './auth/auth.module';
import { AdminModule } from './admin/admin.module';
import { AdminController } from './admin/admin.controller';
import { mysqlConfig } from './config/mysql.config';
// import { CommonRedisService } from './common/common-redis.service';
import { RedisModule } from './redis/redis.module';
import { ServeStaticModule } from '@nestjs/serve-static';
import { join } from 'path';


@Module({
  imports: [
    TypeOrmModule.forRoot(mysqlConfig),
    ProductModule,
    AdminModule,
    AuthModule,
    RedisModule,
    ServeStaticModule.forRoot({
      rootPath: join(__dirname, '..', 'static'),
      serveRoot: "/static",
    }),
  ],
  controllers: [AdminController],
  // providers: [CommonRedisService]
})
export class AppModule { }
